<script setup>
import { inject } from 'vue'

defineProps({
  data: Array
})

const search = inject('search')
</script>

<template>
  <div>
    <h1>Child</h1>
    <el-button @click="search({ child: 'child' })">Search</el-button>
  </div>
  <ul>
    <li
      v-for="item of data"
      :key="item.id"
    >{{ item.text }}</li>
  </ul>
</template>

<style lang="scss" scoped>

</style>